/* ClientAcept.java 
* Created on Dec 6, 2012 
*@Author: Mr.Viet 
*@Phone: 01683430426 
*@Email: phamvanvietcdhd@gmail.com
*/ 
package com.chat; 

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import javax.swing.text.StyledEditorKit.BoldAction;

public class ClientAcept extends Thread {
	private ServerSocket server;
	private Boolean running = true;
	@Override
	public void run() {
		while (this.running){
			Socket client;
			try {
				client = this.server.accept();
				ClientServerTheard clientThread = new ClientServerTheard(client);
				//Day Client Online Vao Mang
				ServerApp.onlineUsers.addElement(clientThread);
				//Bat Cac Tai Nghe Mess Tu Client Nay Nen
				clientThread.start();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
	}
	public ClientAcept(ServerSocket server) {
		this.server = server;
	}

}
